/* Copyright (C) 2021 changwei@iscas.ac.cn
 * 
 * Apache License Version 2.0许可头：
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *    http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
<template>
  <div>
    <el-row :gutter="24">
      <el-col :span="24" style="min-height: 450px">
        <div>
          <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane
              label="企业组织贡献总排名"
              name="organization_contributions"
            >
              <contribution-board-organizations v-bind:data-source="dataL2" />
            </el-tab-pane>

            <el-tab-pane
              label="个人代码贡献总排名"
              name="individual_contributions"
            >
              <contribution-board-individuals v-bind:data-source="dataL3" />
            </el-tab-pane>
          </el-tabs>
        </div>
      </el-col>
    </el-row>
    <br>
    <div class="text" align="right">
      原始数据拉取程序：
      <a href="http://www.openharmony.com/attachment/pr统计.zip">链接</a>
      <br>
      原始数据表：
      <a href="http://www.openharmony.com/attachment/pr数据表.zip">链接</a>
    </div>
  </div>
</template>
<script>
import ContributionBoardCommits from "./ContributionBoardCommits.vue";
import ContributionBoardOrganizations from "./ContributionBoardOrganizations.vue";
import ContributionBoardIndividuals from "./ContributionBoardIndividuals.vue";
// import commits_data_commits from "./contribution_commits.json";
import commits_data_organizations from "./contribution_organizations.json";
import commits_data_individuals from "./contribution_individuals.json";
export default {
  components: {
    ContributionBoardCommits,
    ContributionBoardOrganizations,
    ContributionBoardIndividuals,
  },
  data() {
    return {
      activeName: "organization_contributions",
      // dataL1: commits_data_commits,
      dataL2: commits_data_organizations,
      dataL3: commits_data_individuals,
    };
  },
  methods: {
    handleClick(tab, event) {
      // console.log(tab, event);
    },
  },
};
</script>
<style>
.my-label {
  background: #e1f3d8;
}

.my-content {
  background: #fde2e2;
}
</style>
